home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A Guide to Multimedia
/
Ask Me Multimedia - A Guide to Multimedia Featuring Super Show and Tell (Ask Me Multimedia) (1994).ISO
/
matinee
/
matinee.ms_
/
matinee.bin
Wrap
Text File
|
1993-08-30
|
15KB
|
620 lines
'$define debug
'$include 'setupapi.inc'
'$include 'msdetect.inc'
''Standard Dialog ID's : Make sure these are consistent with STDCUI.H file.
const WELCOME = 100
const ASKQUIT = 200
const DESTPATH = 300
const EXITQUIT = 600
const EXITSUCCESS = 700
''Custom Dialog ID's : Make sure these are consistent with CUIDLG.H file.
const SELECTMODE = 6201
const SELECTCHIP = 6202
const SELECTSIZE = 6203
const TOOBIG = 6204
const SELECTCLIPS = 6205
'' Error IDs
const ERR_BADVGAMODE = 8000
const ERR_BADCPU = 8001
const ERR_BADWINDOWSPATH = 8002
const ERR_BADPATH = 8003
''Bitmap ID
const LOGO = 6101
''Chip sets : Make sure these are consistent with the WhatVga DLL
const CIRRUS = 100
const EVEREX = 101
const PARADISE = 102
const TSENG = 103
const TRIDENT = 104
const T8900 = 105
const ATIVGA = 106
const AHEADA = 107
const AHEADB = 108
const OAKTECH = 109
const VIDEO7 = 110
const CHIPSTECH = 111
const TSENG4 = 112
const GENOA = 113
const NCR = 114
const COMPAQ = 115
const UNKNOWN = -1
''User interface DLL name
const UIDll$ = "cui.dll"
''Constants for functions
''GetProcessor
const IS386 = 3
''GetDeviceCaps
const NUMCOLORS = 24
const SIZEPALETTE = 104
'' Global variable declaration
global MatineePath$ ''Default destination directory.
global WindowsDir$ ''Windows directory.
global MatineeIniPath$ ''Path to the INI file to be used
'' functions/procedure declaration
declare sub ConfirmQuit
declare function MakePath (szDir$, szFile$) as string
declare function GetColors() as integer
'' External function/procedure declaration
declare function GetDC lib "USER.EXE" (hwnd%) as integer
declare function ReleaseDC lib "USER.EXE" (hwnd%, hdc%) as integer
declare function GetDeviceCaps lib "GDI.EXE" (hdc%, iCapabilities%) as integer
Init: '' Start here
'' Set up the error traps
on error goto HandleError
'' Set up the way the install program looks
SetBitmap UIDll$, LOGO
SetTitle "Matinee version 1.0 Setup"
'' Make sure proper hardware is there
if GetProcessorType() < IS386 then
'' We aren't on a 386 or above. FATAL!
error ERR_BADCPU
end if
i% = GetColors()
if i% <= 16 then
'' make sure we didn't just wrap around...
if i% >= 0 then
'' We don't have a VGA driver with 256 colors
'' installed. FATAL!
error ERR_BADVGAMODE
end if
end if
'' Find the INF file
szInfPath$ = GetSymbolValue("STF_SRCINFPATH")
if szInfPath$ = "" then
'' No predefined path for INF file, so just assume it is in
'' the current directory.
szInfPath$ = GetSymbolValue("STF_CWDDIR") + "MATINEE.INF"
end if
'' Load in the INF file
ReadInfFile szInfPath$
'' Set the size checking mode
i% = SetSizeCheckMode(scmOnIgnore)
'' Check that windows diectory is writable
WindowsDir$ = GetWindowsDir()
i% = IsDirWritable(WindowsDir$)
if i% = 0 then
'' Error: can't write to windows directory. exit.
error ERR_BADWINDOWSPATH
endif
'' setup the ini path
MatineeIniPath$ = MakePath(WindowsDir$, "CONTROL.INI")
DOWELCOME:
sz$ = UIStartDlg(UIDll$, WELCOME, "FInfoDlgProc", 0, "")
if sz$ = "CONTINUE" then
UIPop 1
else
ConfirmQuit
goto DOWELCOME
end if
'' Do the main thing
GETPATH:
'' Set up symbols as parameters for dialog box
SetSymbolValue "EditTextIn", "C:\MATINEE"
SetSymbolValue "EditFocus", "ALL"
GETPATHL1:
sz$ = UIStartDlg(UIDll$, DESTPATH, "FEditDlgProc", 0, "")
MatineePath$ = GetSymbolValue("EditTextOut")
if sz$ = "CONTINUE" then
'' Make sure our target is writable
if IsDirWritable(MatineePath$) = 0 then
error ERR_BADPATH
'' will resume here
err = 0
goto GETPATHL1
end if
UIPop 1
elseif sz$ = "REACTIVATE" then
goto GETPATHL1
else
ConfirmQuit
goto GETPATH
end if
'' Set up the defaults before video DLL selection
VgaType$ = "dib"
IsDIB$ = "1"
'' select whether or not to set up chip sets
SELECTSETUPMODE:
SetSymbolValue "RadioDefault", "1"
SELECTSETUPMODEL1:
sz$ = UIStartDlg(UIDll$, SELECTMODE, "FRadioDlgProc", 0, "")
NewMode% = val(GetSymbolValue("ButtonChecked"))
if sz$ = "CONTINUE" then
UIPop 1
elseif sz$ = "REACTIVATE" then
goto SELECTSETUPMODEL1
elseif sz$ = "BACK" then
UIPop 1
goto GETPATH
else
ConfirmQuit
goto SELECTSETUPMODE
end if
select case NewMode%
case 2
'' Select Expert mode
SetupMode% = 0
case else
'' Select Normal mode
SetupMode% = 1
end select
if SetupMode% = 1 then
goto SKIPCHIPSELECT
end if
'' Set up variables for chip select dialog
VideoType = -1
Index$ = "6"
GETTYPE:
'' select the chip type
SetSymbolValue "RadioDefault", Index$
GETTYPEL1:
sz$ = UIStartDlg(UIDll$, SELECTCHIP, "FRadioDlgProc", 0, "")
NewIndex% = val(GetSymbolValue("ButtonChecked"))
if sz$ = "CONTINUE" then
UIPop 1
elseif sz$ = "REACTIVATE" then
goto GETTYPEL1
elseif sz$ = "BACK" then
UIPop 1
goto SELECTSETUPMODE
else
ConfirmQuit
goto GETTYPE
end if
Index$ = str$(NewIndex%)
select case NewIndex%
case 1
IsDIB$ = "0"
VgaType$ = "tsg"
case 2
IsDIB$ = "0"
VgaType$ = "tri"
case 3
IsDIB$ = "0"
VgaType$ = "v7"
case 4
IsDIB$ = "0"
VgaType$ = "cir"
case 5
IsDIB$ = "0"
VgaType$ = "cpq"
case else
IsDIB$ = "1"
VgaType$ = "dib"
end select
SKIPCHIPSELECT:
'' Determine the speed of the machine. For the moment ignore this and
'' just use default for rate and simple size selection
'' default for speed
Rate$ = "30"
'' select the size of the player
if VgaType$ = "dib" then
Size$ = "160"
Small$ = "1"
Index2$ = "2"
else
Size$ = "320"
Small$ = "0"
Index2$ = "1"
end if
GETSIZE:
SetSymbolValue "RadioDefault", Index2$
GETSIZEL1:
sz$ = UIStartDlg(UIDll$, SELECTSIZE, "FRadioDlgProc", 0, "")
NewIndex% = val(GetSymbolValue("ButtonChecked"))
if sz$ = "CONTINUE" then
UIPop 1
elseif sz$ = "REACTIVATE" then
goto GETSIZEL1
elseif sz$ = "BACK" then
UIPop 1
if SetupMode% = 0 then
goto GETTYPE
else
goto SELECTSETUPMODE
end if
else
ConfirmQuit
goto GETSIZE
end if
select case NewIndex%
case 1
Small$ = "0"
Size$ = "320"
case else
Small$ = "1"
Size$ = "160"
end select
STARTCOPYING:
'' prepare directories
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir MatineePath$, cmoNone
'' add the movies
AddSectionFilesToCopyList "Movies", SrcDir$, MatineePath$
'' Add standard files to the copy list
AddSectionFilesToCopyList "Matinee", SrcDir$, MatineePath$
AddSectionFilesToCopyList "Background", SrcDir$, MakePath(MatineePath$, "backgrnd")
AddSectionFilesToCopyList "Windows", SrcDir$, WindowsDir$
'' Complete the file selection process by adding the drivers.
AddSectionKeyFileToCopyList "Drivers", Size$ + VgaType$, SrcDir$, WindowsDir$
'' Determine if there is enough disk space for the installation.
'' DiskSp& will be > 0 if there is NOT enough space. It will be 0 if there
'' is sufficient free disk space for the installation
SpaceCost& = GetCopyListCost(szExtra$,szCosts$, szNeeded$)
'' Tell user how much more space is needed.
if (SpaceCost& > 0) then
SpaceCostKB% = SpaceCost& / 1000
sz$ = str$(SpaceCostKB%)
SetSymbolValue "SpaceNeeded", sz$
sz$ = UIStartDlg(UIDll$, TOOBIG, "FTooBigDlgProc", 0, "")
UIPop 1
error STFQUIT
endif
'' Copy the files
CopyFilesInCopyList
'' Set up the ini file
CreateIniKeyValue MatineeIniPath$, "Screen Saver.Matinee", "MoviePath", MatineePath$, cmoOverwrite
CreateIniKeyValue MatineeIniPath$, "Screen Saver.Matinee", "ReelPath", MakePath(MatineePath$, "movie.lst"), cmoOverwrite
CreateIniKeyValue MatineeIniPath$, "Screen Saver.Matinee", "Rate", Rate$, cmoOverwrite
CreateIniKeyValue MatineeIniPath$, "Screen Saver.Matinee", "Small", Small$, cmoOverwrite
Creat